package com.yan.design.two.establish.s2.f3;

import com.yan.design.two.establish.s2.f2.*;

import java.util.function.Supplier;

/**
 * 3. 抽象工厂
 *      运行
 * @author shengren.yan
 * @create 2022-07-17
 */
public class runMain {

    public static void main(String[] args) {

        // 通过A工厂 创建 A对象
        AFactory a = new AFactory();
        APhone aPhone = (APhone) a.phoneProduct();
        aPhone.sendSMS();
        aPhone.start();

        // 通过B工厂 创建 B对象
        BFactory b = new BFactory();
        BRouter bRouter = (BRouter) b.pouterProduct();
        bRouter.openWifi();
        bRouter.start();

    }


}
//
